<template>
    <div class="nav_con">
        <ul class="nav_list">
            <li class="nav_item"  :class="route=='/space/community'?'nav2_active':''">
                <a href="#/space/community">
                    创客社区
                </a>
            </li>
            <li class="nav_item"  :class="route=='/space/share'?'nav2_active':''">
                <a href="#/space/share">
                    分享空间
                </a>
            </li>
            <li class="nav_item" :class="route=='/space/cmarket'?'nav2_active':''">
                <a href="#/space/cmarket">
                    创客集市
                </a>
            </li>
            
        </ul>
    </div>
</template>

<script>
export default {
    name: 'commonNav',

    data() {
        return {
            route:''
        };
    },
    created(){
        console.log(this.$route)
        this.route = this.$route.path
    },
    watch:{
        $route:{
            handler(newval,oldval){
                console.log('newval:',newval)
                console.log('oldval:',oldval)
                this.route = newval.path
            },
            deep:true,
            immediate:true
        }
    },
    mounted() {
        
    },

    methods: {
        
    },
};
</script>

<style lang="scss" scoped>
   @import  '@/assets/css/common.scss';
</style>